package com.beasts.ant.auth.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author Locker
 * @date 06/06/2018 2:58 PM
 * @since 1.0
 */
@Controller
public class LoginController {

    @RequestMapping("/login")
    public String login(HttpServletRequest req, HttpServletResponse resp) {
        String code = req.getParameter("code");
//        return new ModelAndView("login");
        return "login";
    }

    @RequestMapping("/self/toLogin")
    public String toLogin() {
        return "redirect:/login";
//        return new ModelAndView("login");
    }

    @RequestMapping("/self/login")
    public String slogin() {
        return "slogin";
    }

    @RequestMapping("/self/test")
    public void test(HttpServletRequest req, HttpServletResponse response) {
//        return "test";
        String a = req.getParameter("a");
        System.out.println("xxxxxxxxxxxxxxxxx");
    }

}
